import Vue from 'vue'
import Router from 'vue-router'
import MainPage from '@/components/MainPage'
import SettingPage from '@/components/SettingPage'
import FoamPage from '@/components/FoamPage'
import FilterPage from '@/components/FilterPage'
import HardUpdatePage from '@/components/HardUpdatePage'
import FaultHelpPage from '@/components/FaultHelpPage'
import DeodorizeSettingPage from '@/components/DeodorizeSettingPage'

Vue.use(Router)

export default new Router({
  routes: [{
      path: '/',
      name: 'MainPage',
      component: MainPage,
      meta: {
        index: 0,
        keepAlive: true
      }, //meta对象的index用来定义当前路由的层级,由小到大,由低到高,动画也会根据index值进行相应的更换
      // meta: {keepAlive: true}
    },
    {
      path: '/setting',
      name: 'SettingPage',
      meta: {
        index: 2,
        keepAlive: false
      },
      component: SettingPage,
    },
    {
      path: '/deodorizeSetting',
      name: 'DeodorizeSettingPage',
      meta: {
        index: 2,
        keepAlive: false
      },
      component: DeodorizeSettingPage,
    },

    {
      path: '/foam',
      name: 'FoamPage',
      component: FoamPage,
      meta: {
        index: 2,
        keepAlive: false
      },
    },

    {
      path: '/filter',
      name: 'FilterPage',
      component: FilterPage,
      meta: {
        index: 2,
        keepAlive: false
      },
    },

    {
      path: '/fault',
      name: 'FaultHelpPage',
      component: FaultHelpPage,
      meta: {
        index: 2,
        keepAlive: false
      },
    },

    {
      path: '/hardupdate',
      name: 'HardUpdatePage',
      component: HardUpdatePage,
      meta: {
        index: 2
      },
    },

  ]
})
